package com.wdzl.controller;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

@ControllerAdvice
public class ExceptionController {
    @ExceptionHandler(RuntimeException.class)
    public ModelAndView a(Exception e){
        ModelAndView mv=new ModelAndView ();
        mv.addObject ("because","改变失败，请确定你输入的id号是否正确，或其他问题.");
     mv.addObject ("e",e);
        mv.setViewName ("erroy");
        return mv;
    }
}
